<?php

/**
 * Question form base class.
 *
 * @method Question getObject() Returns the current form's model object
 *
 * @package    tests
 * @subpackage form
 * @author     Djul
 */
abstract class BaseQuestionForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'       => new sfWidgetFormInputHidden(),
      'test_id'  => new sfWidgetFormPropelChoice(array('model' => 'Test', 'add_empty' => false)),
      'level'    => new sfWidgetFormInputText(),
      'mark'     => new sfWidgetFormInputText(),
      'question' => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'id'       => new sfValidatorPropelChoice(array('model' => 'Question', 'column' => 'id', 'required' => false)),
      'test_id'  => new sfValidatorPropelChoice(array('model' => 'Test', 'column' => 'id')),
      'level'    => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'mark'     => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'question' => new sfValidatorString(),
    ));

    $this->widgetSchema->setNameFormat('question[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Question';
  }


}
